<?php
class ent_codetemplate extends Lead_EDO_Object_Abstract
{
    static $_tables = array('ent_codetemplate');
    
    
    
    
    
    
    
    public function base($base)
    {
	    ob_start();
        
        $led_showup = 0;
        $led_outline = 0;
        $theform = "retail";
        $led_pretail = 0;
        
        /*
        if ($led_pretail) {
            if ($_SESSION['led_pretail_mode'] AND !$_SESSION['pretail_basehide'][$this->entid][$base]) {
                $led_showup = $_SESSION['led_pretail_show_up'];
                $led_outline = $_SESSION['ses_outline_bases'];
                $theform = "pretail";
            }
        }
        */
        
        if ($led_outline) {
            print "<div class=\"LED_base base_$base\">";
        }
        
        $app = Led_Application::getInstance();
        
                
        $coll = new Led_Entity_Collection($app->getAppid(), null, $app->getLangid(), 2000000001, $app->getPageid(), $base);
        
        $coll->getGlobals(true);
                
        print $coll->render();
        
        // $rendered = LED_List_Render($theform, 1, $led_showup, $appid, -1, $langid, 2000000001 , $naviid, $base);
        
        /*
        if ($led_admin) {
        if (!$_SESSION['pretail_basehide'][$this->entid][$base]) {
        if (($rendered->size - $rendered->hasglobal == 0) AND $_SESSION['led_pretail_mode'] AND $led_pretail AND $_SESSION['led_pretail_show_up']) {
        print "<div class=\"blank_insert\">\n";	
        $location = NULL;
        $reloc = "$adminroot/action.php?action=addentity&amp;autoclose=0&amp;theappid=$rendered->appid&amp;thelangid=$rendered->langid&amp;listid=$rendered->listid&amp;parent=$rendered->parent&amp;base=$rendered->base&amp;isglobal=$rendered->hasglobal&amp;typeid=0";
        $reloc_addon = "&amp;orrder=1";
        $attribs = "scrollbars=1,resizable=no,width=" . $theme['win']['large'] . ",height=" . $theme['win']['normal'];
        LED_Window_PopupButton($reloc . $reloc_addon, "create_entity", $texts['new_entity_up'], $location, $attribs, NULL);
        print "</div>\n";
        }
        }
        }
        */
        
        if ($led_outline) {
            print "</div>";
        }

        return ob_get_clean();
        
    }

}